package com.example.d3.character.compare;

import java.util.HashMap;

/* Class to hold data about a diablo 3 hero
 * 
 */
public class HeroData {
	private String m_name;
	private String m_class;
	private int m_id;
	private int m_level;
	private int m_pLevel;
	private int m_lastUsed;
	private boolean m_hardcore;
	private boolean m_dead;
	private int m_gender;
	private HashMap<String, Double> m_stats;
	
	//Constructors
	public HeroData(){
		m_id = -1;
		m_stats = new HashMap<String, Double>();
	}
	
	public HeroData(String name, int id, int level, int pLevel, boolean hc, boolean dead, int gender, String className, int lastUsed){
		m_name = name;
		m_id = id;
		m_level = level;
		m_pLevel = pLevel;
		m_hardcore = hc;
		m_dead = dead;
		m_gender = gender;
		m_class = className;
		m_lastUsed = lastUsed;
		m_stats = new HashMap<String, Double>();
	}
	
	//Getters
	public boolean isValid(){
		return m_id > 0;
	}
	public String name(){
		return m_name;
	}
	public String className(){
		return m_class;
	}
	public int id(){
		return m_id;
	}
	public int level(){
		return m_level;
	}
	public int ParaLevel(){
		return m_pLevel;
	}
	public int lastUsed(){
		return m_lastUsed;
	}
	public int gender(){
		return m_gender;
	}
	public boolean hardcore(){
		return m_hardcore;
	}
	public boolean dead(){
		return m_dead;
	}
	
	public void addStat(String stat, Double value){
		m_stats.put(stat, value);
	}
	
	public HashMap<String, Double> getStats(){
		return m_stats;
	}
	
	/* JSON example of hero data
	 * URL - http://us.battle.net/api/d3/profile/banished-1684/hero/5331557
	{
	"id" : 5331557,
	"name" : "Banished",
	"class" : "wizard",
	"gender" : 0,
	"level" : 60,
	"paragonLevel" : 2,
	"hardcore" : false
	"stats" : {
		"life" : 48733,
		"damage" : 14306.4,
		"attackSpeed" : 1.399999976158142,
		"armor" : 4700,
		"strength" : 219,
		"dexterity" : 295,
		"vitality" : 1115,
		"intelligence" : 1244,
		"physicalResist" : 370,
		"fireResist" : 326,
		"coldResist" : 450,
		"lightningResist" : 365,
		"poisonResist" : 359,
		"arcaneResist" : 400,
		"critDamage" : 1.5,
		"damageIncrease" : 12.4399995803833,
		"critChance" : 0.2849999964237213,
		"damageReduction" : 0.6103900074958801,
		"blockChance" : 0.0,
		"thorns" : 320.0,
		"lifeSteal" : 0.0,
		"lifePerKill" : 0.0,
		"goldFind" : 0.2,
		"magicFind" : 0.41,
		"blockAmountMin" : 0,
		"blockAmountMax" : 0,
		"lifeOnHit" : 977.0,
		"primaryResource" : 109,
		"secondaryResource" : 0
	},
	"kills" : {
		"elites" : 2468
	}
	}
	*/
	
}
